/*
 * Copyright 2012-2019 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.boot.autoconfigure.web.servlet;

import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import org.springframework.web.servlet.mvc.method.annotation.ExceptionHandlerExceptionResolver;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

/**
 * 用于替代 Spring MVC 默认组件，注册 {@link WebMvcConfigurationSupport} 关键组件的接口。
 * <p>
 * 所有自定义实例随后会被 Spring Boot 和 Spring MVC 配置处理。此组件应仅注册单例，
 * 否则会导致无法从重复的 MVC 组件中进行选择。
 *
 * @author Brian Clozel
 * @since 2.0.0
 * @see org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration.EnableWebMvcConfiguration
 */
public interface WebMvcRegistrations {

	/**
	 * 返回用于 MVC 配置并由其处理的自定义 {@link RequestMappingHandlerMapping} 实例。
	 * @return 自定义的 {@link RequestMappingHandlerMapping} 实例
	 */
	default RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
		return null;
	}

	/**
	 * 返回用于 MVC 配置并由其处理的自定义 {@link RequestMappingHandlerAdapter} 实例。
	 * @return 自定义的 {@link RequestMappingHandlerAdapter} 实例
	 */
	default RequestMappingHandlerAdapter getRequestMappingHandlerAdapter() {
		return null;
	}

	/**
	 * 返回用于 MVC 配置并由其处理的自定义 {@link ExceptionHandlerExceptionResolver} 实例。
	 * @return 自定义的 {@link ExceptionHandlerExceptionResolver} 实例
	 */
	default ExceptionHandlerExceptionResolver getExceptionHandlerExceptionResolver() {
		return null;
	}

}
